<!--{include(pe_tpl('header.html'));}-->
<div class="huiyuan_content">
	<!--{include(pe_tpl('user_menu.html'));}-->
	<div class="fr huiyuan_main">
		<div class="hy_tt">
			<a href="{$pe['host']}user.php?mod=pay" <!--{if($menumark=='pay'):}-->class="sel"<!--{endif;}-->>账户充值<i></i></a>
			<a href="{$pe['host']}user.php?mod=cashout&act=add" <!--{if($menumark=='cashout_add'):}-->class="sel"<!--{endif;}-->>申请提现<i></i></a>
			<a href="{$pe['host']}user.php?mod=cashout" <!--{if($menumark=='cashout_list'):}-->class="sel"<!--{endif;}-->>提现记录<i></i></a>
		</div>
		<div class="hy_table">
		<form method="post" id="form" autocomplete="off">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td style="text-align:right;" width="150">钱包余额：</td>
			<td><span class="corg">{$info['user_money']} 元</span></td>
		</tr>
		<tr>
			<td style="text-align:right;">收款账户：</td>
			<td>
				<select name="userbank_id" class="inputselect">
				<option value="">请选择收款账户</option>
				<!--{foreach($userbank_list as $k=>$v):}-->
				<option value="{$v['userbank_id']}">{$v['userbank_nameshow']}</option>
				<!--{endforeach;}-->
				</select>
			</td>
		</tr>
		<tr>
			<td style="text-align:right;">提现金额：</td>
			<td><input type="text" name="cashout_money" class="inputall input100" /> 元</td>
		</tr>
		<tr>
			<td style="text-align:right;">扣手续费：</td>
			<td><span id="cashout_fee">0</span> 元</td>
		</tr>
		<tr>
			<td style="text-align:right;">实到金额：</td>
			<td><span id="cashout_jsmoney">0</span> 元</td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="hidden" name="pe_token" value="{$pe_token}" />
				<input type="hidden" name="pesubmit" />	
				<input type="button" value="提 交"  class="tjbtn" />
			</td>
		</tr>
		</table>
		</form>
		<!--{if($info['cashout_desc'] != ''):}-->
		<div class="tixing c888" style="margin-top:70px"><p class="cred mab10">温馨提示：</p>{$info['cashout_desc']}</div>
		<!--{endif;}-->
		</div>
	</div>
	<div class="clear"></div>
</div>
<script type="text/javascript">
$(function(){
	if ({count($userbank_list)} == 0) {
		pe_alert('请先添加收款账户', function(){
			pe_open('user.php?mod=userbank&act=add&from={urlencode(pe_nowurl())}');
		});
	}
	$(":input[name='cashout_money']").bind('keyup blur', function(){
		var cashout_money = pe_num($(this).val(), 'floor', 2);
		var cashout_fee = pe_num(cashout_money * {$info['cashout_fee_bili']}, 'floor', 2);
		var cashout_jsmoney = pe_num(cashout_money - cashout_fee, 'floor', 2);
		$("#cashout_fee").html(cashout_fee);
		$("#cashout_jsmoney").html(cashout_jsmoney);
	})
	$(":button").click(function(){
		var cashout_money = pe_num($(":input[name='cashout_money']").val(), 'float', 1);
		if (cashout_money <= 0) {
			pe_tip('请填写提现金额');
			return false;
		}
		pe_submit("user.php?mod=cashout&act=add", function(json){
			if (json.code == 1) {
				pe_open("user.php?mod=cashout", 1000);	
			}
		})
	})
})
</script>
<!--{include(pe_tpl('footer.html'));}-->